package com.yunyike.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yunyike.dto.SummaryMerchandiseDTO;
import com.yunyike.mapper.SkuSummaryMapper;
import com.yunyike.model.SkuSummary;
import com.yunyike.service.SkuSummaryService;

@Service("skuSummaryServiceImpl")
public class SkuSummaryServiceImpl implements SkuSummaryService{

	private Logger log = LoggerFactory.getLogger(SkuSummaryServiceImpl.class);
	
	@Autowired
	private  SkuSummaryMapper skuSummaryMapper;

	
	public void checkSummaryDto(List<SummaryMerchandiseDTO> summaryList){
		if(summaryList!=null&&summaryList.size()>0){
			for(SummaryMerchandiseDTO summary :summaryList){
				SkuSummary sum = selectBySkuId(summary.getSkuId());
				summary.setSkuSummary(sum);
			}
		}
	}
	public SkuSummary selectBySkuId(String skuId) {
		return skuSummaryMapper.selectBySkuId(skuId);
	}
	
	public int deleteByPrimaryKey(String skuSummaryId) {
		return skuSummaryMapper.deleteByPrimaryKey(skuSummaryId);
	}

	public int insert(SkuSummary record) {
		return skuSummaryMapper.insert(record);
	}

	public int insertSelective(SkuSummary record) {
		return skuSummaryMapper.insertSelective(record);
	}

	public SkuSummary selectByPrimaryKey(String skuSummaryId) {
		return skuSummaryMapper.selectByPrimaryKey(skuSummaryId);
	}

	public int updateByPrimaryKeySelective(SkuSummary record) {
		return skuSummaryMapper.updateByPrimaryKeySelective(record);
	}

	public int updateByPrimaryKey(SkuSummary record) {
		return skuSummaryMapper.updateByPrimaryKey(record);
	}

	
	

}
